package com.rear.inter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.rear.entity.XatLogEntity;
import com.rear.inter.base.BaseAction;
import com.rear.inter.base.JsonVo;
import com.rear.service.XatLogService;
import com.rear.utils.JsonUtil;
/**
 * 
* 
* 类名称：ComInterface 
* 类描述： 
* 创建人：October
* 修改备注： 
* @version 1.0
 */
@RequestMapping("/interface/com")
@Controller
public class ComInterface extends BaseAction{
	
	@Autowired
	private XatLogService xatLogService;
	
	@RequestMapping(value = "/addXatLog.json", method = RequestMethod.GET)
	public  void addXatLog(
			//渠道来源：学安通/学安成长/...
			String qdly,
			//操作类型：浏览/点击/...
			String czlx,
			//操作主题：XX页面/XX按钮/XX...
			String czzt,
			//操作链接
			String linkurl,
			String mark,
			String exp1,
			String exp2,
			String exp3,
			String exp4,
			String exp5,
			HttpServletResponse response,
			HttpServletRequest request) {
		JsonVo<String> json = new JsonVo<String>();
		try {
			XatLogEntity xatLog=new XatLogEntity();
			xatLog.setQdly(qdly);
			xatLog.setCzlx(czlx);
			xatLog.setCzzt(czzt);
			xatLog.setLinkurl(linkurl);
			xatLog.setMark(mark);
			xatLog.setExp1(exp1);
			xatLog.setExp2(exp2);
			xatLog.setExp3(exp3);
			xatLog.setExp4(exp4);
			xatLog.setExp5(exp5);
			xatLogService.save(xatLog);
			json.setResult(true);
		} catch (Exception e) {
			e.printStackTrace();
			json.setMsg("添加日志出错！");
			json.setResult(false);
		}
		ajaxJsonResponse(response,request,JsonUtil.beanToJson(json));
	}
}
